package com.ruoyi.project.warehouse.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.warehouse.mapper.WareWarehouseTotalMapper;
import com.ruoyi.project.warehouse.domain.WareWarehouseTotal;
import com.ruoyi.project.warehouse.service.IWareWarehouseTotalService;

/**
 * 总仓库Service业务层处理
 * 
 * @author 萧雪
 * @date 2022-09-03
 */
@Service
public class WareWarehouseTotalServiceImpl implements IWareWarehouseTotalService 
{
    @Autowired
    private WareWarehouseTotalMapper wareWarehouseTotalMapper;

    /**
     * 查询总仓库
     * 
     * @param id 总仓库主键
     * @return 总仓库
     */
    @Override
    public WareWarehouseTotal selectWareWarehouseTotalById(Long id)
    {
        return wareWarehouseTotalMapper.selectWareWarehouseTotalById(id);
    }

    /**
     * 查询总仓库列表
     * 
     * @param wareWarehouseTotal 总仓库
     * @return 总仓库
     */
    @Override
    public List<WareWarehouseTotal> selectWareWarehouseTotalList(WareWarehouseTotal wareWarehouseTotal)
    {
        return wareWarehouseTotalMapper.selectWareWarehouseTotalList(wareWarehouseTotal);
    }

    /**
     * 新增总仓库
     * 
     * @param wareWarehouseTotal 总仓库
     * @return 结果
     */
    @Override
    public int insertWareWarehouseTotal(WareWarehouseTotal wareWarehouseTotal)
    {
        wareWarehouseTotal.setCreateTime(DateUtils.getNowDate());
        return wareWarehouseTotalMapper.insertWareWarehouseTotal(wareWarehouseTotal);
    }

    /**
     * 修改总仓库
     * 
     * @param wareWarehouseTotal 总仓库
     * @return 结果
     */
    @Override
    public int updateWareWarehouseTotal(WareWarehouseTotal wareWarehouseTotal)
    {
        wareWarehouseTotal.setUpdateTime(DateUtils.getNowDate());
        return wareWarehouseTotalMapper.updateWareWarehouseTotal(wareWarehouseTotal);
    }

    /**
     * 批量删除总仓库
     * 
     * @param ids 需要删除的总仓库主键
     * @return 结果
     */
    @Override
    public int deleteWareWarehouseTotalByIds(Long[] ids)
    {
        return wareWarehouseTotalMapper.deleteWareWarehouseTotalByIds(ids);
    }

    /**
     * 删除总仓库信息
     * 
     * @param id 总仓库主键
     * @return 结果
     */
    @Override
    public int deleteWareWarehouseTotalById(Long id)
    {
        return wareWarehouseTotalMapper.deleteWareWarehouseTotalById(id);
    }
}
